<?php

class Application_Form_Login extends Zend_Form {

    public function init() {
        $this->setName('Login');
        $userName = new Zend_Form_Element_Text('userName');
        $userName->setLabel('Nom: ')
                ->setRequired();
        $pwdValide = new Zend_Validate_Regex('((?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{6,20})');
        $pwdValide->setMessage("6 à 20 Caracteres max, dont 1 chifre et une MAJ");
        $password = new Zend_Form_Element_Password('password');
        $password->setLabel('Mot de passe:')
                ->setRequired();
                //->addValidator($pwdValide);
        $login = new Zend_Form_Element_Submit('login');
        $login->setLabel('Envoyer');
        $this->addElements(array($userName, $password, $login))
                ->setMethod('post');
                
    }

}

